package com.yiquan.search.client;

import entity.PageResult;
import entity.Result;
import entity.StatusCode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author xieyl
 * @create 2022/4/1 15:59
 */
@FeignClient("yiquan-user")
public interface UserClient {

    @RequestMapping(value = "/user/getUserByUserId", method = RequestMethod.GET)
    public Result findByUserId(@RequestParam Long userId);

    @RequestMapping(value = "/user/isFollow",method = RequestMethod.GET)
    public Result isFollow(@RequestParam  Long userId, @RequestParam Long theUserId);

    /**
     * 分页+多条件查询
     *
     * @param searchMap 查询条件封装
     * @param page      页码
     * @param size      页大小
     * @return 分页结果
     */
    @RequestMapping(value = "/user/search/{page}/{size}", method = RequestMethod.POST)
    public Result findSearch(@RequestBody Map searchMap, @PathVariable("page") int page, @PathVariable("size") int size) ;

}